package com.yc.navy.goods.service.lmpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yc.navy.goods.bean.CollectionInfo;
import com.yc.navy.goods.mapper.ICollectionInfoMapper;
import com.yc.navy.goods.service.ICollectionInfoService;
import com.yc.navy.goods.util.StringUtil;

@Service
public class CollectionInfoServiceImpl implements ICollectionInfoService {
	@Autowired
	private ICollectionInfoMapper collectionInfoMapper;
	
	@Override
	public Integer addCollection(CollectionInfo collection) {
		System.out.println(collection + " = collection");
		if(StringUtil.checkNull(collection.getPid().toString(),collection.getPics(),collection.getName(),collection.getPrice().toString())) {
			return -1;
		}
		return collectionInfoMapper.addCollection(collection);
	}

	@Override
	public List<CollectionInfo> findCollection(Integer mid) {
		return collectionInfoMapper.findCollection(mid);
	}

	@Override
	public CollectionInfo checkCollection(CollectionInfo collection) {
		return collectionInfoMapper.checkCollection(collection);
	}

	@Override
	public Integer deleteCollection(Integer ccid) {
		return collectionInfoMapper.deleteCollection(ccid);
	}

}
